package com.lrz.answerPlatform.mapper;

import com.lrz.answerPlatform.model.dto.statistic.AppAnswerCountDTO;
import com.lrz.answerPlatform.model.dto.statistic.AppAnswerResultCountDTO;
import com.lrz.answerPlatform.model.entity.UserAnswer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Nuyoahl
 * @description 针对表【user_answer(用户答题记录)】的数据库操作Mapper
 * @createDate 2025-07-07 16:29:41
 * @Entity com.lrz.answerPlatform.model.entity.UserAnswer
 */
public interface UserAnswerMapper extends BaseMapper<UserAnswer> {


        @Select("select resultName, count(resultName) as resultCount from user_answer " +
                "where appId = #{appId} group by resultName order by resultCount desc")
        List<AppAnswerResultCountDTO> doAppAnswerResultCount(Long appId);



    List<AppAnswerCountDTO> doAppAnswerCount();
}




